package apiooday03;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class NewForDemo {
    public static void main(String[] args) {
        String[] arr= {"aaa","bbb","ccc"};
        for (int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }
        for (String str:arr){
            System.out.println(str);
        }

        Collection<String> cc= new ArrayList<>();
        cc.add("ddd");
        cc.add("www");
        cc.add("qqq");
        Iterator it =cc.iterator();
        while (it.hasNext()){
            String str =(String) it.next();
            System.out.println(str);
        }

        for (String obj:cc){
            //String str = obj;
            System.out.println(obj);
        }
    }
}
